package com.base.core.head.dto.ai;

import com.gitee.magic.core.annotations.Column;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter@Setter@ToString
public class MessageContentDataDTO  extends MessageBaseDTO{

	private String type;

	private String audio;
	
	@Column("image_url")
	private MessageContentDataUrlBO imageUrl;
	
	@Column("video_url")
	private MessageContentDataUrlBO videoUrl;

	private String text;
	
	public static MessageContentDataDTO ofImage(String url) {
		MessageContentDataDTO i=new MessageContentDataDTO();
		i.setType("image_url");
		i.setImageUrl(new MessageContentDataUrlBO(url));
		return i;
	}
	
	public static MessageContentDataDTO ofVideo(String url) {
		MessageContentDataDTO i=new MessageContentDataDTO();
		i.setType("video_url");
		i.setVideoUrl(new MessageContentDataUrlBO(url));
		return i;
	}
	
	public static MessageContentDataDTO ofAudio(String url) {
		MessageContentDataDTO i=new MessageContentDataDTO();
		i.setAudio(url);
		return i;
	}
	
	public static MessageContentDataDTO ofText(String text) {
		MessageContentDataDTO i=new MessageContentDataDTO();
		i.setType("text");
		i.setText(text);
		return i;
	}
	
	public static MessageContentDataDTO ofTextNoType(String text) {
		MessageContentDataDTO i=new MessageContentDataDTO();
		i.setText(text);
		return i;
	}
	
	@Setter@Getter@ToString
	@AllArgsConstructor
	public static class MessageContentDataUrlBO {

		private String url;
		
	}
	
}
